package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Studydeviations entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "studydeviations", catalog = "bms")
public class Studydeviations implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date dateDetected;
	private String deviationFormReceived;
	private String deviationType;
	private String forSignificantsDev;
	private String pidIssue;
	private String receivedExternalEc;
	private String receivedLocalEc;
	private String receivedTeachingC;
	private String submissionExternalEc;
	private String submissionLocalEc;
	private String submissionMoh;
	private String submissionTeachingC;
	private boolean trainingLog;
    private Integer scope;

    public static final String CLASSTITLE = "Study Deviations";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("pidIssue", "PID - Issue");
                            put("dateDetected", "Date Detected");
                            put("deviationFormReceived", "Deviation Form Received at BMS");
                            put("deviationType", "Deviation Type");
                            put("trainingLog", "Training Log Available");
                            put("submissionExternalEc", "Submission to External EC");
                            put("receivedExternalEc", "Received by External EC (stamped)");
                            put("submissionLocalEc", "Submission to Local EC");
                            put("receivedLocalEc", "Received by Local EC (stamped)");
                            put("submissionTeachingC", "Submission to Teaching Committee");
                            put("receivedTeachingC", "Received by Teaching Committee");
                            put("submissionMoh", "Submission to MOH");
                            put("forSignificantsDev", "For Significant Devs");
                        }
                    }
            )
    );

    // Constructors

	/** default constructor */
	public Studydeviations() {
	}

	/** minimal constructor */
	public Studydeviations(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Studydeviations(ProtocoloCentro protocoloCentro, Date dateDetected,
			String deviationFormReceived, String deviationType,
			String forSignificantsDev, String pidIssue,
			String receivedExternalEc, String receivedLocalEc,
			String receivedTeachingC, String submissionExternalEc,
			String submissionLocalEc, String submissionMoh,
			String submissionTeachingC, boolean trainingLog) {
		this.protocoloCentro = protocoloCentro;
		this.dateDetected = dateDetected;
		this.deviationFormReceived = deviationFormReceived;
		this.deviationType = deviationType;
		this.forSignificantsDev = forSignificantsDev;
		this.pidIssue = pidIssue;
		this.receivedExternalEc = receivedExternalEc;
		this.receivedLocalEc = receivedLocalEc;
		this.receivedTeachingC = receivedTeachingC;
		this.submissionExternalEc = submissionExternalEc;
		this.submissionLocalEc = submissionLocalEc;
		this.submissionMoh = submissionMoh;
		this.submissionTeachingC = submissionTeachingC;
		this.trainingLog = trainingLog;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateDetected", length = 10)
	public Date getDateDetected() {
		return this.dateDetected;
	}

	public void setDateDetected(Date dateDetected) {
		this.dateDetected = dateDetected;
	}

	@Column(name = "deviationFormReceived")
	public String getDeviationFormReceived() {
		return this.deviationFormReceived;
	}

	public void setDeviationFormReceived(String deviationFormReceived) {
		this.deviationFormReceived = deviationFormReceived;
	}

	@Column(name = "deviationType")
	public String getDeviationType() {
		return this.deviationType;
	}

	public void setDeviationType(String deviationType) {
		this.deviationType = deviationType;
	}

	@Column(name = "forSignificantsDev")
	public String getForSignificantsDev() {
		return this.forSignificantsDev;
	}

	public void setForSignificantsDev(String forSignificantsDev) {
		this.forSignificantsDev = forSignificantsDev;
	}

	@Column(name = "pidIssue")
	public String getPidIssue() {
		return this.pidIssue;
	}

	public void setPidIssue(String pidIssue) {
		this.pidIssue = pidIssue;
	}

	@Column(name = "receivedExternalEC")
	public String getReceivedExternalEc() {
		return this.receivedExternalEc;
	}

	public void setReceivedExternalEc(String receivedExternalEc) {
		this.receivedExternalEc = receivedExternalEc;
	}

	@Column(name = "receivedLocalEC")
	public String getReceivedLocalEc() {
		return this.receivedLocalEc;
	}

	public void setReceivedLocalEc(String receivedLocalEc) {
		this.receivedLocalEc = receivedLocalEc;
	}

	@Column(name = "receivedTeachingC")
	public String getReceivedTeachingC() {
		return this.receivedTeachingC;
	}

	public void setReceivedTeachingC(String receivedTeachingC) {
		this.receivedTeachingC = receivedTeachingC;
	}

	@Column(name = "submissionExternalEC")
	public String getSubmissionExternalEc() {
		return this.submissionExternalEc;
	}

	public void setSubmissionExternalEc(String submissionExternalEc) {
		this.submissionExternalEc = submissionExternalEc;
	}

	@Column(name = "submissionLocalEC")
	public String getSubmissionLocalEc() {
		return this.submissionLocalEc;
	}

	public void setSubmissionLocalEc(String submissionLocalEc) {
		this.submissionLocalEc = submissionLocalEc;
	}

	@Column(name = "submissionMHO")
	public String getSubmissionMoh() {
		return this.submissionMoh;
	}

	public void setSubmissionMoh(String submissionMoh) {
		this.submissionMoh = submissionMoh;
	}

	@Column(name = "submissionTeachingC")
	public String getSubmissionTeachingC() {
		return this.submissionTeachingC;
	}

	public void setSubmissionTeachingC(String submissionTeachingC) {
		this.submissionTeachingC = submissionTeachingC;
	}

	@Column(name = "trainingLog")
	public boolean getTrainingLog() {
		return this.trainingLog;
	}

	public void setTrainingLog(boolean trainingLog) {
		this.trainingLog = trainingLog;
	}

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}